<?php
/*
 * Copyright 2011 by Alex Lucyk, Jesus Navarro, and Allen Tucker.
 * This program is part of RMH Homeroom, which is free software.
 * It comes with absolutely no warranty.  You can redistribute and/or
 * modify it under the terms of the GNU Public License as published
 * by the Free Software Foundation (see <http://www.gnu.org/licenses/).
*/
/**
 * Inserts 6 persons, 2 bookings, and 5 loaners into the database as a "sandbox" to facilitate
 * testing of user interface functionality.  Run this right after dbInstall.php
 * @version April 1, 2011
 * @author Allen
 */
?>

<html>
<title>
Database Sandbox Initialization
</title>
<body>
<?php
	include_once('dbPersons.php');
    include_once('dbBookings.php');
	include_once('dbLoaners.php');
	$person = new Person("Smith", "John", "123 College Street","Brunswick", "ME", "04011", "2077291234", "", 
    	"email@bowdoin.edu", "guest", "Willie Smith", "98-01-01", "parent" ,""); insert_dbPersons($person);
    $person = new Person("Smith", "Meghan", "3 Congress Street","Podrtand", "ME", "04103", 2075551234, "", 
    	"email@bowdoin.edu", "guest", "Tiny Smith", "98-01-01", "parent", ""); insert_dbPersons($person);
    $person = new Person("Jones", "Bob", "100 Union Street","Bangor", "ME", "04401", 2075555678, null, 
    	"bjones@gmail.com", "guest", "Dan Jones", "95-07-15", "grandfather", "" ); insert_dbPersons($person);
    $person = new Person("Adams", "Millie", "12 River Road","Augusta", "ME", "04330", 2073631234, 2075553434, 
    	"wadams@yahoo.com", "socialworker", null, null, null, "" ); insert_dbPersons($person);
    $person = new Person("Williams", "Elizabeth", "50 Main Street","Portland", "ME", "04110", 2075555432, null, 
    	"ewilliams@comcast.net", "volunteer", null, null, null, ""); insert_dbPersons($person);
    $person = new Person("Little", "Gabrielle", "250 Brackett Street","Portland", "ME", "04102", 2077806282, 2075550000, 
    	"housemngr@rmhportland.org", "manager", null, null, null, "" ); insert_dbPersons($person);
    $person = new Person("Lucyk", "Alex", "Bowdoin College","Brunswick", "ME", "04011", 2077806282, 2075550000, 
    	"azlucyk@gmail.com", "manager", null, null, null, "" ); insert_dbPersons($person);
    $person = new Person("Navarro", "Jesus", "Bowdoin College","Brunswick", "ME", "04011", 2077806282, 2075550000, 
    	"jnavarro@bowdoin.edu", "manager", null, null, null, "" ); insert_dbPersons($person);
    $person = new Person("Tucker", "Allen", "42 Walini Way","Harpswell", "ME", "04079", 2077298111, 2078419604, 
    	"allen@bowdoin.edu", "manager", null, null, null, "" ); insert_dbPersons($person);
            
    $loaner = new Loaner("remote1", "remote", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("remote2", "remote", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("fan1", "fan", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("fan2", "fan", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("airbed1", "airbed", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("airbed2", "airbed", "available", null); insert_dbLoaners($loaner);
    
    $b = new Booking("11-02-07","Meghan2075551234","Tiny",
              array("Meghan:mother", "Jean:father", "Teeny:sibling"),
              array("fan2", "remote1"),
              "Millie2073631234","Maine Med");
    $b->add_loaner("airbed3");
	$b->add_occupant("Jordan","brother");
    $b->assign_room("223");
    insert_dbBookings($b);
    $b = new Booking("11-02-08","John2077291234","Willie",
              array("Sara:mother", "John:father", "Winky:sibling"),
              array(),"Millie2073631234","Maine Med");
    insert_dbBookings($b);
    $loaner = new Loaner("remote1", "remote", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("remote2", "remote", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("fan1", "fan", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("fan2", "fan", "available", null); insert_dbLoaners($loaner);
    $loaner = new Loaner("airbed1", "airbed", "available", null); insert_dbLoaners($loaner);
        
    echo "<p>Sandbox installed</p>"
?>
</body>
</html>